import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 38917
 * Date: 2025-02-14
 * Time: 00:11
 */
public class login {
    //编写代码模拟三次密码输入的场景。 最多能输入三次密码，密码正确，提示“登录成功”,密码错误， 可以重新输 入，最多输入三次。三次均错，则提示退出程序
    public static void main(String[] args) {
        int count = 1;
        int key = 10;
        while (count <= 3){
            Scanner in = new Scanner(System.in);
            int a = in.nextInt();
            if (a != key) {
                count++;
                System.out.println("密码错误");
            }else {
                System.out.println("密码正确");
                break;
            }
        }
        if(count >= 3){
            System.out.println("没有机会了");
        }
    }
}
